home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ May 89 / U0011-Changing field labe-May89 < prev    next >
Encoding:
Text File  |  1989-06-26  |  1.5 KB  |  41 lines  |  [TEXT/GEOL]

  1. Item    5347844                         5-May-89        20:40
  2.  
  3. From:   CDA0373                         AUC Lakehead University
  4.  
  5. To:     MACAPP.TECH$                    MACAPP Tech
  6.  
  7. Sub:    Changing field labels|CDA0373
  8.  
  9. Is it possible to change the field identifiers of an object by means of
  10. constants?
  11.  
  12. An example is the following:
  13.     I have a very general object, say TGeneralObj, which has as a field, say
  14. fGeneralField. These type definitions are contained in an interface unit, say
  15. UGeneralObj.p. Now I need a more specialized extension of this object.
  16. Moreover, in this specialized extension, people are used to using different
  17. names to identify the various fields. Thus to make the code more readable and
  18. the names more intuitive, it would be nice to employ these specialized names in
  19. the specialized extension.
  20.     What I would like to do is, in the interface, USpecializedObj.p, define
  21.  
  22.         CONST
  23.             fSpecializedField = fGeneralField;
  24.                     .
  25.                     .
  26.         TYPE
  27.             TSpecializedObj = OBJECT(TGeneralObj)
  28.                           .
  29.                           .
  30.                           .
  31.            END;
  32.  
  33. Now all new and/or OVERRIDE methods can actually use the more specialized name,
  34. even though they are talking about the same field.
  35.  
  36. Will this work?  Is it advisable?  Would a user need to know anything, save
  37. that the fGeneralField and the fSpecializedField labels apply to the same thing
  38. in the specialized situation?
  39.  
  40.  
  41.